﻿@model IEnumerable<CloudFranceTriple.WebRole.Models.UserProfile>
@{
    
    ViewBag.Title = String.Format(CloudFranceTriple.WebRole.Properties.Resources.GamingPlayerIndexTitle, Model.Count());
    Layout = "~/Views/Shared/_Layout.cshtml";    
}
<div class="content-padding">
    <h1>@ViewBag.Title</h1>
    <section>
        <br />
        <table>
            <tr>
                <th></th>
                <th>
                    @CloudFranceTriple.WebRole.Properties.Resources.GamingPlayerName
                </th>
                @if (User.IsInRole("RoleHR"))
                {
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.LoginRegisterEmail
                    </th>
                }
                <th>
                    @CloudFranceTriple.WebRole.Properties.Resources.LoginRegisterLocation
                </th>
                <th>
                    @CloudFranceTriple.WebRole.Properties.Resources.LoginRegisterLastRequestDate
                </th>
                <th>
                    @CloudFranceTriple.WebRole.Properties.Resources.LoginRegisterForumMessagePostedCounterShort
                </th>
                <th></th>
            </tr>

            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.Action("ShowGravatar", new { id = item.UserId })
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.UserName)
                    </td>
                    @if (User.IsInRole("RoleHR"))
                    {
                        <td>
                            @Html.DisplayFor(modelItem => item.Email)
                        </td>
                    }
                    <td>
                        @Html.DisplayFor(modelItem => item.Location)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.LastRequestDate, "TemplateUserDateTime")
                    </td>
                    <td style="text-align: right;">
                        @Html.DisplayFor(modelItem => item.ForumMessagePostedCounter)
                    </td>
                    <td>@Html.ActionLink(@CloudFranceTriple.WebRole.Properties.Resources.ButtonPrivateMessage, "Create", "PrivateMessage", new { id = item.UserId, area = "Forum" }, null)</td>
                </tr>
            }
        </table>
        <br />
        <br />
    </section>
</div>
